//
//  MtimeNavigationController.m
//  Mtime2.0
//
//  Created by 凉气的Mac on 16/9/24.
//  Copyright © 2016年 凉气的Mac. All rights reserved.
//

#import "MtimeNavigationController.h"

@interface MtimeNavigationController ()

@end

@implementation MtimeNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{

    if (self.childViewControllers.count > 0) {
        
        UIButton *backBtn = [UIButton creatWithTitle:@"返回" color:[UIColor whiteColor] fontSize:16];
        
        [backBtn addTarget:self action:@selector(clickBack) forControlEvents:UIControlEventTouchUpInside];
        
        viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn];
    }
    
    [super pushViewController:viewController animated:animated];
}

-(void)clickBack{

    [self popViewControllerAnimated:YES];

}

@end
